package com.googlecode.lookie.platform.laf;

import java.util.Set;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;

import com.googlecode.lookie.swing.laf.LookAndFeelDescriptorContributor;
import com.googlecode.lookie.swing.laf.LookAndFeelRegistry;

public class LookAndFeelDescriptorContributorExecutor
    implements InitializingBean
{

    @Autowired
    private LookAndFeelRegistry lookAndFeelRegistry;

    private Set<LookAndFeelDescriptorContributor> contributors;

    public void setContributors( Set<LookAndFeelDescriptorContributor> contributors )
    {
        this.contributors = contributors;
    }

    public void afterPropertiesSet()
        throws Exception
    {
        for ( LookAndFeelDescriptorContributor contributor : contributors )
        {
            contributor.contribute( lookAndFeelRegistry );
        }
    }

}
